/ Assembly List / LJCNetCommon / CodeTokenizer / IsKeyword

Namespace - LJCNetCommon


Parameters
text - The text value.
firstPass - The first pass for common values.

Returns

True if a keyword, otherwise false.

Syntax

C#
public Boolean IsKeyword(String text, Boolean firstPass = False)

Check if the text is a Keyword. (E)

Example

C#
using LJCNetCommon;

var tokenizer = new CodeTokenizer();
string text = " if (text == \"DataValue\"");
tokenizer.SetTokens(text);
short tokenIndex = 0;
string token = tokenizer.GetToken(tokenIndex);

int prefixCount = 0;
string stripToken = tokenizer.StripQualifier(token, ref prefixCount);
bool isKeyword = tokenizer.IsKeyword(stripToken);
// Value isDataType = true.

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.